﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Client
{
    public partial class OpenNewRoomForm : Form
    {
        private string openWith;


        public delegate void OpenRoom(string roomName, string openWith); 


        public event OpenRoom openRoom;
        

        public OpenNewRoomForm(string openWith)
        {
            this.openWith = openWith;
            InitializeComponent();
        }

        private void OpenBtn_Click(object sender, EventArgs e)
        {
            openRoom(roomNameTbx.Text, openWith);
            this.Close();
        }

        private void roomNameTbx_TextChanged(object sender, EventArgs e)
        {
            if (roomNameTbx.Text.Trim().Length > 0)
                OpenBtn.Enabled = true;
            else
                OpenBtn.Enabled = false;
        }


    }
}
